<template>
  <div>
      
  </div>
</template>
<script>
import Api from '@/api';
export default {
  name: '',
  components:{},
  data() {
    return {
        param:{
           code:"",
           state:"" 
        }
      
    };
  },
  created() {
    this.openFullScreen2()
    console.log(this.$route)
    this.param.code = this.$route.query.code
    this.param.state = this.$route.query.state
    if(this.param.state){
        Api.checkLoginForGoogle(this.param).then(res=>{
            console.log(res)
            // to do :返回绑定账户信息或者注册或者直接成功跳转首页
        })
    }else if(!this.param.state&&this.param.code){
        Api.checkLoginForFacebook(this.param).then(res=>{
            console.log(res)
             // to do :返回绑定账户信息或者注册或者直接成功跳转首页
        })
    }else{
        this.$router.push({path:"*"})
    }

  },
  methods: {
    openFullScreen2() {
        const loading = this.$loading({
          lock: true,
          text: 'Loading',
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
        });
        // setTimeout(() => {
        //   loading.close();
        // }, 2000);
      }
  },
};
</script>
<style lang="scss" scoped>
.el-loading-spinner i{
    font-size: 30px !important;
}
</style>
